package com.zaoke.web.bo.food;

import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class Food {
	
	public static int STATE_ACTIVE = 0;
	
	public static int STATE_INACTIVE = 1;
	
	public static int FOOD_TYPE_MAIN = 1;
	
	public static int FOOD_TYPE_DRINK = 2;

	private Long id;
	
	private String name;
	
	private Integer type;
	
	private Double salePrice;
	
	private String salePriceStr;
	
	private String desc;
	
	private Integer state;
	
	private Integer sequence;
	
	private Long addUserid;
	
	private Date addTime;
	
	private Long lastmodUserid;

	private Date lastmodTime;
	
	private FoodImage image;
	
	private FoodImage imagepc; 
	
	private FoodPromotion promotion;
	
	private List<FoodTag> tags;
	
	private Set<FoodNutrition> nutritions;
	
	private Long userid;
	
	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Double getSalePrice() {
		return salePrice;
	}

	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Integer getSequence() {
		return sequence;
	}

	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}

	public Long getAddUserid() {
		return addUserid;
	}

	public void setAddUserid(Long addUserid) {
		this.addUserid = addUserid;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public Long getLastmodUserid() {
		return lastmodUserid;
	}

	public void setLastmodUserid(Long lastmodUserid) {
		this.lastmodUserid = lastmodUserid;
	}

	public Date getLastmodTime() {
		return lastmodTime;
	}

	public void setLastmodTime(Date lastmodTime) {
		this.lastmodTime = lastmodTime;
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,ToStringStyle.SHORT_PREFIX_STYLE);
	}

	public FoodImage getImage() {
		return image;
	}

	public void setImage(FoodImage image) {
		this.image = image;
	}

	public FoodPromotion getPromotion() {
		return promotion;
	}

	public void setPromotion(FoodPromotion promotion) {
		this.promotion = promotion;
	}

	public List<FoodTag> getTags() {
		return tags;
	}

	public void setTags(List<FoodTag> tags) {
		this.tags = tags;
	}

	public Set<FoodNutrition> getNutritions() {
		return nutritions;
	}

	public void setNutritions(Collection<FoodNutrition> nutritions) {
		this.nutritions = new HashSet<FoodNutrition>();
		if(nutritions!=null)
		{
			this.nutritions.addAll(nutritions);
		}
	}

	public String getSalePriceStr() {
		return salePriceStr;
	}

	public void setSalePriceStr(String salePriceStr) {
		this.salePriceStr = salePriceStr;
	}

	public FoodImage getImagepc() {
		return imagepc;
	}

	public void setImagepc(FoodImage imagepc) {
		this.imagepc = imagepc;
	}
}

